#ifndef _DSWLOCALTRANSSESSION_H
#define _DSWLOCALTRANSSESSION_H

#include "tcpcombase.h"

class CDswlocaltranssession : public CTcpcombase
{
public:
	CDswlocaltranssession();
	virtual ~CDswlocaltranssession();
public:
	CDswlocaltranssession(LPST_ENV_T pEnv, struct bufferevent * pBev, int nHeadSize, char* pKey);
	static CDswlocaltranssession* createNew(LPST_ENV_T pEnv, struct event_base *base, int nfd, int nHeadSize, char* pKey);
private:
	virtual int MakePayloadLength(char* pData, int nLen){return *((int*)pData);};
	virtual bool ProcessMessage(char* pMsg, int nLen, struct evbuffer *outbuf);

	bool ProcessHeader(char* pHeader);
	bool TransData(char* pData, int nLen);
private:
	ST_LOCAL_TRANS_T m_nDest;
	bool m_bStart;
};

#endif

